package com.bjsxt.chapter11_flyWeight;

/**
 * @ClassName ConcreteChessFlyWeight
 * @Description 共享的内部状态类
 * @Author 黑马程序员
 * @Date 15:52 2024/6/22
 * @Version 1.0
 **/
public class ConcreteChessFlyWeight implements ChessFlyWeight{

    private String color;

    public ConcreteChessFlyWeight(String color) {
        this.color = color;
    }

    @Override
    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String getColor() {
        return color;
    }

    @Override
    public void display(Coordinate c) {
        System.out.println("棋子颜色: " + color);
        System.out.println("棋子坐标: " + c.getX() + "-----" + c.getY());
    }
}
